/**
 * class VideoDescriptionView extends EntityView
 */
function VideoDescriptionView(video) {

	// VideoDescriptionView extends EntityView
	EntityView.call(this);

	// @overide
	this.setEntity = function(entity) {

		var tr = document.createElement("tr");

		var imgTd = document.createElement("td");
		imgTd.className = "img-td";
		var commentsTd = document.createElement("td");
		commentsTd.className = "comments-td";

		tr.appendChild(imgTd);
		tr.appendChild(commentsTd);

		var a = document.createElement("a");
		a.href = "api.php?controller=EmisionPageController&do=getVideo&params[id]=" + entity.id;
		a.target = "_blank";
		var img = document.createElement("img");
		img.src = entity.imgUri;
		img.className = "comments-img";
		a.appendChild(img);
		imgTd.appendChild(a);

		var commentsTable = document.createElement("table");
//		commentsTable.border = 1;
		commentsTable.className = "comments-table";
		var commentsTbody = document.createElement("tbody");
		commentsTable.appendChild(commentsTbody);

		commentsTd.appendChild(commentsTable);

		var titleTr = document.createElement("tr");		
		commentsTbody.appendChild(titleTr);

		var titleTitletd = document.createElement("td");
		titleTitletd.className = "title-title-td";
		var titleTitleTextNode = document.createTextNode("Título:");
		titleTitletd.appendChild(titleTitleTextNode);
		titleTr.appendChild(titleTitletd);

		var titleTextTd = document.createElement("td");
		titleTextTd.className = "title-text-td";
		titleTr.appendChild(titleTextTd);
		var titleTextNode = document.createTextNode(entity.title);		
		titleTextTd.appendChild(titleTextNode);


		var descriptionTr = document.createElement("tr");
		commentsTbody.appendChild(descriptionTr);

		var descriptionTitletd = document.createElement("td");
		descriptionTitletd.className = "description-title-td";
		var descriptionTitleNode = document.createTextNode("Descripción:");
		descriptionTitletd.appendChild(descriptionTitleNode);
		descriptionTr.appendChild(descriptionTitletd);

		var descriptionTextTd = document.createElement("td");
		descriptionTextTd.className = "description-text-td";

		var descriptionTextNode = document.createTextNode(entity.description);
		var wrapDiv = document.createElement("div");
		wrapDiv.className = "wrap-div";
		wrapDiv.appendChild(descriptionTextNode);
		descriptionTextTd.appendChild(wrapDiv);
		descriptionTr.appendChild(descriptionTextTd);

		var divisionTr = document.createElement("tr");
		var divisionTd = document.createElement("td");
		divisionTd.colSpan = 2;
		divisionTr.appendChild(divisionTd);
		var divisionHr = document.createElement("hr");
		divisionTd.appendChild(divisionHr);

		this.tbody.appendChild(tr);
		this.tbody.appendChild(divisionTr);

		this.entity = entity;
	};
	
	this.setEntity(video);
}